package com.augurit.common.util;

import java.util.Date;
import java.util.GregorianCalendar;

public class QueryDateFieldUtils {

	public static final int ALL_DAYS = -1;
	
	/** 
	 * 计算距当前日期前days天的日期
	 * @param days 天数
	 * @return
	 */
	public static Date getDateFromNow(int days)
	{
		GregorianCalendar grc = new GregorianCalendar();
		grc.setTime(new Date());
		grc.roll(GregorianCalendar.DAY_OF_YEAR, -days);
        return grc.getTime();
	}
}
